home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 1998
- // Author: Duncan Brinsmead
- //
- // Description:
- //
-
- global proc strokeOptionsCallback( string $parent, string $whichCallback)
- {
- global string $gCreatorWireCtx;
- string $whichCtx = $gCreatorWireCtx;
-
- setParent $parent;
- int $rval;
- int $ival;
- float $fval;
-
-
- switch( $whichCallback )
- {
- case "Pmap1":
- case "Pmap2":
- case "Pmap3":
- if( $whichCallback == "Pmap1" )
- $opt = `optionMenuGrp -q -v pressureMapping1`;
- else if( $whichCallback == "Pmap2" )
- $opt = `optionMenuGrp -q -v pressureMapping2`;
- else
- $opt = `optionMenuGrp -q -v pressureMapping3`;
- if( $opt == "scale" )
- {
- $rval = 1;
- }
- else if( $opt == "width" )
- {
- $rval = 2;
- }
- else if( $opt == "softness" )
- {
- $rval = 3;
- }
- else if( $opt == "color" )
- {
- $rval = 4;
- }
- else if( $opt == "transparency" )
- {
- $rval = 5;
- }
- else if( $opt == "tube width" )
- {
- $rval = 6;
- }
- else if( $opt == "tube length" )
- {
- $rval = 7;
- }
- else if( $opt == "incandescence" )
- {
- $rval = 8;
- }
- else if( $opt == "glow spread" )
- {
- $rval = 9;
- }
- else if( $opt == "tubes per step" )
- {
- $rval = 10;
- }
- else if( $opt == "elevation" )
- {
- $rval = 11;
- }
- else if( $opt == "azimuth" )
- {
- $rval = 12;
- }
- else if( $opt == "path follow" )
- {
- $rval = 13;
- }
- else if( $opt == "path attract" )
- {
- $rval = 14;
- }
- else if( $opt == "random" )
- {
- $rval = 15;
- }
- else if( $opt == "wiggle" )
- {
- $rval = 16;
- }
- else if( $opt == "curl" )
- {
- $rval = 17;
- }
- else if( $opt == "noise" )
- {
- $rval = 18;
- }
- else if( $opt == "turbulence" )
- {
- $rval = 19;
- }
- else if( $opt == "num twigs" )
- {
- $rval = 20;
- }
- else if( $opt == "num leaves" )
- {
- $rval = 21;
- }
- else if( $opt == "num petals" )
- {
- $rval = 22;
- }
- else if( $opt == "surface offset" )
- {
- $rval = 23;
- }
- else
- {
- $rval = 0;
- }
- if( $whichCallback == "Pmap1" )
- dynWireCtx -e -pm1 $rval $whichCtx;
- else if( $whichCallback == "Pmap2" )
- dynWireCtx -e -pm2 $rval $whichCtx;
- else
- dynWireCtx -e -pm3 $rval $whichCtx;
- break;
- case "surfaceOffset":
- $fval = `floatSliderGrp -q -v "surfaceOffset"`;
- dynWireCtx -e -sof $fval $whichCtx;
- break;
- case "pressureMin1":
- $fval = `floatSliderGrp -q -v "pressureMin1"`;
- dynWireCtx -e -ps1 $fval $whichCtx;
- break;
- case "pressureMin2":
- $fval = `floatSliderGrp -q -v "pressureMin2"`;
- dynWireCtx -e -ps2 $fval $whichCtx;
- break;
- case "pressureMin3":
- $fval = `floatSliderGrp -q -v "pressureMin3"`;
- dynWireCtx -e -ps3 $fval $whichCtx;
- break;
- case "pressureMax1":
- $fval = `floatSliderGrp -q -v "pressureMax1"`;
- dynWireCtx -e -px1 $fval $whichCtx;
- break;
- case "pressureMax2":
- $fval = `floatSliderGrp -q -v "pressureMax2"`;
- dynWireCtx -e -px2 $fval $whichCtx;
- break;
- case "pressureMax3":
- $fval = `floatSliderGrp -q -v "pressureMax3"`;
- dynWireCtx -e -px3 $fval $whichCtx;
- break;
- case "displayQuality":
- $fval = `floatSliderGrp -q -v "displayQuality"`;
- dynWireCtx -e -dq $fval $whichCtx;
- break;
- }
- }
-
- proc string getMapping( int $index )
- {
- string $str;
-
- switch( $index )
- {
- case 1:
- $str = "scale";
- break;
- case 2:
- $str = "width";
- break;
- case 3:
- $str = "softness";
- break;
- case 4:
- $str = "color";
- break;
- case 5:
- $str = "transparency";
- break;
- case 6:
- $str = "tube width";
- break;
- case 7:
- $str = "tube length";
- break;
- case 8:
- $str = "incandescence";
- break;
- case 9:
- $str = "glow spread";
- break;
- case 10:
- $str = "tubes per step";
- break;
- case 11:
- $str = "elevation";
- break;
- case 12:
- $str = "azimuth";
- break;
- case 13:
- $str = "path follow";
- break;
- case 14:
- $str = "path attract";
- break;
- case 15:
- $str = "random";
- break;
- case 16:
- $str = "wiggle";
- break;
- case 17:
- $str = "curl";
- break;
- case 18:
- $str = "noise";
- break;
- case 19:
- $str = "turbulence";
- break;
- case 20:
- $str = "num twigs";
- break;
- case 21:
- $str = "num leaves";
- break;
- case 22:
- $str = "num petals";
- break;
- case 23:
- $str = "surface offset";
- break;
- default:
- $str = "off";
- break;
- }
- return $str;
- }
-
-
- proc pressuremappings()
- {
- menuItem -l "off" aOff;
- menuItem -l "scale" aScale;
- menuItem -l "width" aWidth;
- menuItem -l "softness" aSoftness;
- menuItem -l "color" aColor;
- menuItem -l "transparency" aTransparency;
- menuItem -l "tube width" aTubeWidth;
- menuItem -l "tube length" aTubeLength;
- menuItem -l "incandescence" aIncandescence;
- menuItem -l "glow spread" aGlowSpread;
- menuItem -l "tubes per step" aTubesPerStep;
- menuItem -l "elevation" aElevation;
- menuItem -l "azimuth" aAzimuth;
- menuItem -l "path follow" aPathFollow;
- menuItem -l "path attract" aPathAttract;
- menuItem -l "random" aRandom;
- menuItem -l "wiggle" aWiggle;
- menuItem -l "curl" aCurl;
- menuItem -l "noise" aNoise;
- menuItem -l "turbulence" aTurbulence;
- menuItem -l "num twigs" aNumTwigs;
- menuItem -l "num leaves" aNumLeaves;
- menuItem -l "num petals" aNumPetals;
- menuItem -l "surface offset" aSurfaceOffset;
- }
-
- global proc strokeOptionsUpdate( string $parent )
- {
- string $str;
- global string $gCreatorWireCtx;
- string $whichCtx = $gCreatorWireCtx;
- setParent $parent;
-
- $str = getMapping( `dynWireCtx -q -pm1 $whichCtx` );
- optionMenuGrp -e -v $str "pressureMapping1";
- $str = getMapping( `dynWireCtx -q -pm2 $whichCtx` );
- optionMenuGrp -e -v $str "pressureMapping2";
- $str = getMapping( `dynWireCtx -q -pm3 $whichCtx` );
- optionMenuGrp -e -v $str "pressureMapping3";
-
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- floatSliderGrp -e -v `dynWireCtx -q -sof $whichCtx` "surfaceOffset";
- }
- floatSliderGrp -e -v `dynWireCtx -q -ps1 $whichCtx` "pressureMin1";
- floatSliderGrp -e -v `dynWireCtx -q -ps2 $whichCtx` "pressureMin2";
- floatSliderGrp -e -v `dynWireCtx -q -ps3 $whichCtx` "pressureMin3";
- floatSliderGrp -e -v `dynWireCtx -q -px1 $whichCtx` "pressureMax1";
- floatSliderGrp -e -v `dynWireCtx -q -px2 $whichCtx` "pressureMax2";
- floatSliderGrp -e -v `dynWireCtx -q -px3 $whichCtx` "pressureMax3";
-
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- floatSliderGrp -e -v `dynWireCtx -q -dq $whichCtx` "displayQuality";
- checkBoxGrp -e -v1 `dynWireCtx -q -pd $whichCtx` "paintAtDepth";
- }
- }
-
-
- global proc paintEffectsProperties () {
- //
- // Description:
- // This procedure builds the property sheet and assigns callbacks to
- // its controls. The state of the controls are set in paintEffectsValues().
- //
- //
-
- string $parent = `toolPropertyWindow -q -location`;
- setParent $parent;
-
- setUITemplate -pushTemplate OptionsTemplate;
-
- // create the top-level layout. This must have the
- // same name as the string returned from getClassName
- columnLayout -adj true paintEffects;
- $parent += "/paintEffects";
-
- global string $gCreatorWireCtx;
- string $whichCtx = $gCreatorWireCtx;
-
- columnLayout -adj true dynPaint_Tab;
-
- // context options for dynPaint.
- //
- frameLayout -collapsable true -collapse false
- -l "Stroke Settings" dynPaintFrame;
- columnLayout dynPaintOptions;
- separator -style "none";
- $parent = `setParent -query`;
-
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- checkBoxGrp
- -label ""
- -l1 "Paint at Depth"
- -ncb 1
- -onc ("dynWireCtx -e -pd true " + $whichCtx)
- -ofc ("dynWireCtx -e -pd false " + $whichCtx)
- paintAtDepth;
- separator -style "none";
- floatSliderGrp -label "Display Quality"
- -field true
- -min 0.0 -max 100.0
- -fmn 0.0 -fmx 10000.0
- -v 100.0
- -precision 2
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"displayQuality\")")
- displayQuality;
- separator -style "none";
- floatSliderGrp -label "Surface Offset"
- -field true
- -min -1.0 -max 1.0
- -fmn -10000 -fmx 10000.0
- -v 0.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"surfaceOffset\")")
- surfaceOffset;
- }
-
- optionMenuGrp -l "Pressure Mapping 1"
- -cc ("strokeOptionsCallback(\""+$parent+"\",\"Pmap1\")")
- pressureMapping1;
- pressuremappings();
-
- floatSliderGrp -label "Pressure Min 1"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMin1\")")
- pressureMin1;
-
- floatSliderGrp -label "Pressure Max 1"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMax1\")")
- pressureMax1;
-
- optionMenuGrp -l "Pressure Mapping 2"
- -cc ("strokeOptionsCallback(\""+$parent+"\",\"Pmap2\")")
- pressureMapping2;
- pressuremappings();
-
- floatSliderGrp -label "Pressure Min 2"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMin2\")")
- pressureMin2;
-
- floatSliderGrp -label "Pressure Max 2"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMax2\")")
- pressureMax2;
-
- optionMenuGrp -l "Pressure Mapping 3"
- -cc ("strokeOptionsCallback(\""+$parent+"\",\"Pmap3\")")
- pressureMapping3;
- pressuremappings();
-
- floatSliderGrp -label "Pressure Min 3"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMin3\")")
- pressureMin3;
-
- floatSliderGrp -label "Pressure Max 3"
- -field true
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- -precision 4
- -cc ("strokeOptionsCallback(\""
- +$parent+"\",\"pressureMax3\")")
- pressureMax3;
-
- separator -style "none";
- setParent ..; // dynPaintOptions
- setParent ..; // dynPaintFrame
- setParent ..; // dynPaint_Tab
-
- setUITemplate -popTemplate;
-
- strokeOptionsUpdate( $parent );
-
- }
-
-
-
- global proc paintEffectsValues( string $toolName ){
-
- // this method is exceptional, in that the values we are displaying
- // are not really tool-related. Therefore, this method can
- // be empty.
-
- string $helpTag = "PaintEffectsTool";
- toolPropertySetCommon $toolName "paintEffectsTool.xpm" $helpTag;
- toolPropertySelect "paintEffects";
-
- string $parent = `toolPropertyWindow -q -location`;
- strokeOptionsUpdate $parent;
-
- }
-
-